package com.oig.common.exception;

import org.springframework.http.HttpStatus;

public class BadRequestException extends RuntimeException  {

    private int code = HttpStatus.BAD_REQUEST.value();

    public int getCode() {
        return code;
    }

    public BadRequestException(String message){
        super(message);
    }

    public BadRequestException(int code, String message){
        super(message);
        this.code = code;
    }


    public BadRequestException(ErrorCodeEnum error){
        super(error.getErrmsg());
        this.code = error.getCode();
    }
}
